const express = require("express");
const auth = require("../middlewares/auth");
const router = express.Router();

/* 欢迎首页 */
router.get("/", (req, res, next) => {
  res.render("index", { title: "Express" });
});

router.get("/chat", auth, (req, res) => {
  res.render("chat", { username: req.user.username });
});

module.exports = router;
